package loyaltypartner.service;

import java.util.Map;

import loyaltypartner.dao.PaybackDAO;

@SuppressWarnings("serial")
public class BlockMemberServlet extends AbstractPaybackServlet 
{
	@Override
	protected Object getBusinessMethod(Map<String, String[]> params)
	{
		String result = "Invalid parameters";
		
		String[] memberID = params.get("memberID");
		if(memberID!=null && memberID.length>0)
		{
			try
			{
				PaybackDAO.fetchDAO().blockMember(memberID[0]);
				result = "SUCCESS";
			}
			catch (RuntimeException e)
			{
//				e.printStackTrace();
				result = "FAIL";
			}
		}
		
		return result;
	}
}
